export const getYearMonthDay = (value) => {
  const date = value ? new Date(value) : new Date()
  const day = date.getDate()
  const month = date.getMonth()
  const year = date.getFullYear()
  return [year, month, day]
}

export const getCurrentMonthLastDay = (year, month) => {
  return new Date(year, month + 1, 0).getDate()
}

export const getPrevMonthLastDay = (year, month) => {
  return new Date(year, month, 0).getDate()
}
export const cloneDate = (date) => {
  return date ? new Date(date.getTime()) : new Date()
}
export const creatDate = (date) => {
  if (date) {
    date = date.replace('年', '-')
    date = date.replace('月', '-')
    date = date.replace('日', '')
  }
  return date ? new Date(date) : new Date()
}
